package com.sgb.kjwl.view.widget.packers;

import android.content.Context;
import android.view.WindowManager;
import android.widget.ImageView;

import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.user.AddressEntity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteInfoActivity;
import com.swgk.core.dialog.BasePopWindow;
import com.swgk.core.dialog.PopViewHolder;

import java.util.List;

/**
 * @author : younghow
 * @date : 2021/11/5 15:19
 * description:
 */
public class TeamMainCompanyPupWindow extends BasePopWindow {

    private TeamMenuView mTmvAttend,mTmvLeaguer ,mTmvMember,mTmvRecommend;
    private TeamMenuView.OnItemClick onItemClick = new TeamMenuView.OnItemClick(){
        @Override
        public void onItemClick(AddressEntity entity, int position, int num) {
            super.onItemClick(entity, position, num);
            WebsiteInfoActivity.start(mContext, entity.getNo(), WebsiteInfoActivity.WEBSITE_FOR_COMPANY);
        }
    };

    public TeamMainCompanyPupWindow(Context context) {
        super(context, DIR_DOWN_UP);
    }

    @Override
    protected int popLayout() {
        return R.layout.window_main_company;
    }

    @Override
    protected void initView(PopViewHolder holder) {

        mTmvAttend = holder.getPop().findViewById(R.id.tmv_attend);

        mTmvLeaguer = holder.getPop().findViewById(R.id.tmv_leaguer);

        mTmvMember = holder.getPop().findViewById(R.id.tmv_member);

        mTmvRecommend = holder.getPop().findViewById(R.id.tmv_recommend);

        this.setHeight(WindowManager.LayoutParams.MATCH_PARENT);
        this.setWidth(WindowManager.LayoutParams.MATCH_PARENT);
        this.setClippingEnabled(false);

        ImageView imageView = holder.getPop().findViewById(R.id.iv_main_pop_window_cancel);
        imageView.setOnClickListener(v -> dismiss());
    }


    public void setDataAttend(List<AddressEntity> data){
        mTmvAttend.initData(3,3,data);
    }

    public void setDataLeaguer(List<AddressEntity> data){

        mTmvLeaguer.initData(3,3,data);
    }

    public void setDataMember(List<AddressEntity> data){
        mTmvMember.initData(3,3,data);
    }


    public void setDataRecommend(List<AddressEntity> data){
        mTmvRecommend.initData(3,3,data);
    }
}
